package No_1.Calculator;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class Calculator {
    double x,y;
    String op;
    public void op(){
        if (op.equals("+")){
            System.out.println(x+y);
        }
        else if (op.equals("-")){
            System.out.println(x-y);
        }
        else if (op.equals("*")){
            System.out.println(x*y);
        }
        else if (op.equals("/")){
            if (y==0){
                System.out.println("被除数不能为0");
            }else {
                System.out.println(x/y);
            }
        }
    }
}
